home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Magnum One
/
Magnum One (Mid-American Digital) (Disc Manufacturing).iso
/
d12
/
cbibcode.arc
/
GETXTSTG.C
< prev
next >
Wrap
Text File
|
1991-08-05
|
1KB
|
32 lines
/* getxtstg.c --- gettextsettings, p. 843 */
#include <graphics.h>
char *font_names[] = { "Default Font", "Triplex Font", "Small Font",
"Sans Serif Font", "Gothic Font"};
char *h_justify[] = { "LEFT", "CENTER", "RIGHT"};
char *v_justify[] = { "BOTTOM", "CENTER", "TOP"};
char *text_dir[] = { "Horizontal", "Vertical"};
main()
{
int graphdriver = DETECT, graphmode;
struct textsettingstype textinfo;
char buf[80];
/* Detect and initialize graphics system */
initgraph(&graphdriver, &graphmode, "c:\\turboc");
/* Retrieve current text settings and report them */
gettextsettings(&textinfo);
outtextxy(10, 10, "Current text settings are: ");
sprintf(buf, "Font: %s", font_names[textinfo.font]);
outtextxy(10, 24, buf);
sprintf(buf, "Character size: %d", textinfo.charsize);
outtextxy(10, 34, buf);
sprintf(buf, "Direction of text: %s", text_dir[textinfo.direction]);
outtextxy(10, 44, buf);
sprintf(buf, "Horizontal justification: %s", h_justify[textinfo.horiz]);
outtextxy(10, 54, buf);
sprintf(buf, "vertical justification: %s", v_justify[textinfo.vert]);
outtextxy(10, 64, buf);
outtextxy(getmaxx() / 2, getmaxy() - 50, "Press any key to exit:");
getch(); /* Wait until a key is pressed */
closegraph(); /* Exit graphics library */
}